package io.github.talelin.latticy.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @authoer:wulongbo
 * @createDate:2022/10/8
 * @description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
//索引名称必须全部小写，不能有大写字母，配置下面的映射后项目启动会自动创建索引productbean，不需要手动创建
@Document(indexName = "productbean", shards = 3, replicas = 1 )
public class ProductBean {

    @Id
    private String id;//产品id

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String productCode;//产品编码

    @Field(type = FieldType.Keyword)
    private String productName;//产品名称

    private String productProcessId;//工艺id

    private String productProcessCode;//工艺编号

    @Field(type = FieldType.Double)
    private Double price;//商品价格

    @Field(type = FieldType.Keyword, index = false)
    private String images;//图片地址
}
